<%@ page contentType="text/html; charset=UTF-8"%>

<!DOCTYPE html>
<!--[if IE 9 ]><html class="ie9"><![endif]-->
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
        <meta name="format-detection" content="telephone=no">
        <meta charset="UTF-8">

        <meta name="description" content="">
        <meta name="keywords" content="">

        <title></title>
            
        <!-- CSS -->
        <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
        <link href="/ynrfinance/static/css/bootstrap.min.css" rel="stylesheet">
        <link href="/ynrfinance/static/css/bootstrap-datetimepicker.min.css">
        <link href="/ynrfinance/static/css/animate.min.css" rel="stylesheet">
        <link href="/ynrfinance/static/css/font-awesome.min.css" rel="stylesheet">
        <link href="/ynrfinance/static/css/form.css" rel="stylesheet">
        <link href="/ynrfinance/static/css/calendar.css" rel="stylesheet">
        <link href="/ynrfinance/static/css/style.css" rel="stylesheet">
        <link href="/ynrfinance/static/css/icons.css" rel="stylesheet">
        <link href="/ynrfinance/static/css/generics.css" rel="stylesheet">
        <style>
        .control_panel_active span{
		    color: #FFD600;
		}
		
		.control_panel_active small{
		    color: #FFD600;
		}
		.control_panel_active{
			background: rgba(0,0,0,0.6);
		}
		.chzn-container-multi .chzn-choices {
			width:300px;
		}
		.chzn-container .chzn-drop {
			width:300px;
		}
		table, th, td
		  {
		  border: 1px solid white;
		  }
        </style>
    </head>
    <body id="skin-cloth">
        <header id="header" class="media">
            <a href="" id="menu-toggle"></a> 
            <a class="logo pull-left" href="/ynrfinance/home">尤耐锐数据科技</a>
            <div class="media-body">
                <div class="media" id="top-menu">
                    <div id="time" class="pull-right">
                        <span id="hours"></span>
                        :
                        <span id="min"></span>
                        :
                        <span id="sec"></span>
                    </div>
                </div>
            </div>
        </header>
        
        <div class="clearfix"></div>
        
        <section id="main" class="p-relative" role="main">
            <!-- Sidebar -->
            <aside id="sidebar">
                <!-- Sidbar Widgets -->
                <div class="side-widgets overflow">
                    <!-- Profile Menu -->
                    <div class="text-center s-widget m-b-25 dropdown" id="profile-menu">
                        <a href="" data-toggle="dropdown">
                            <img class="profile-pic animated" src="/ynrfinance/static/img/but.png" alt="">
                        </a>
                        <ul class="dropdown-menu profile-menu">
                            <li><a href="javascript:void(0);" class='logout_btn'>退出登录</a></li>
                        </ul>
                        <h4 class="m-0">系统管理员</h4>
                    </div>
                    
                    <!-- Calendar -->
                    <div class="s-widget m-b-25">
                        <div id="sidebar-calendar"></div>
                    </div>
                </div>
                
                <!-- Side Menu -->
                <ul class="list-unstyled side-menu">
                    <li>
                        <a class="sa-side-home" href="/ynrfinance/home">
                            <span class="menu-item">主页</span>
                        </a>
                    </li>
                    <li class="dropdown active">
                        <a class="sa-side-form" href="">
                            <span class="menu-item">发票</span>
                        </a>
                        <ul class="list-unstyled menu-item">
                            <li><a href="/ynrfinance/pendingInvoice">待处理发票</a></li>
                            <li><a class="active" href="/ynrfinance/invoiceUpload">发票上传</a></li>
                            <li><a href="/ynrfinance/invoiceEnter">手工录入</a></li>
                        </ul>
                    </li>
                </ul>

            </aside>
        
            <!-- Content -->
            <section id="content" class="container">                
                <!-- Breadcrumb -->
                <ol class="breadcrumb hidden-xs">
                    <li><a href="#">主页</a></li>
                </ol>
                
                <h4 class="page-title">控制面板</h4>
                                
                <!-- Shortcuts -->
                <div class="block-area shortcut-area">
                    <a class="shortcut tile" href="/ynrfinance/pendingInvoice">
                        <span class="icon">&#61698;</span>
                        <small class="t-overflow">待处理发票</small>
                    </a>
                    <a class="shortcut tile" href="/ynrfinance/invoiceUpload">
                        <span class="icon">&#61787;</span>
                        <small class="t-overflow">发票上传</small>
                    </a>
                    <a class="shortcut tile" href="/ynrfinance/salesUpload">
                        <span class="icon">&#61787;</span>
                        <small class="t-overflow">销售清单上传</small>
                    </a>
                    <a class="shortcut tile" href="/ynrfinance/invoiceEnter">
                        <span class="icon">&#61706;</span>
                        <small class="t-overflow">手工录入</small>
                    </a>
                    <a class="shortcut tile" href="/ynrfinance/claimingExpenses">
                        <span class="icon">&#61840;</span>
                        <small class="t-overflow">报销费用</small>
                    </a>
                    <a class="shortcut tile" href="/ynrfinance/bankUpload">
                        <span class="icon">&#61814;</span>
                        <small class="t-overflow">银行对账单上传</small>
                    </a>
                    <a class="shortcut tile" href="/ynrfinance/salaryUpload">
                        <span class="icon">&#61700;</span>
                        <small class="t-overflow">工资表上传</small>
                    </a>
                    <a class="shortcut tile control_panel_active" href="/ynrfinance/auditVoucher">
                        <span class="icon">&#61900;</span>
                        <small class="t-overflow">审核凭证</small>
                    </a>
                    <a class="shortcut tile" href="/ynrfinance/voucher">
                        <span class="icon">&#61788;</span>
                        <small class="t-overflow">查看凭证</small>
                    </a>
                    <a class="shortcut tile" href="/ynrfinance/trial">
                        <span class="icon">&#61932;</span>
                        <small class="t-overflow">科目余额表</small>
                    </a>
                    <a class="shortcut tile" href="/ynrfinance/sheet">
                        <span class="icon">&#61769;</span>
                        <small class="t-overflow">基础报表</small>
                    </a>
                </div>
                <div class="clearfix"></div>
                <hr class="whiter"/>
                <div id="error_tips"></div>
                <div style="margin:10px 10px;float:left;">              
	                <select data-placeholder="选择公司..." class="tag-select-limited" multiple></select>
	            </div>
				<div style="margin:10px 10px;width:150px;float:left;">
				     <input type="text" id="bill_date" class="input-sm form-control mask-time" placeholder="会计期间（如201908）" autocomplete="off">
				</div>
	            <div style="margin:10px 10px;float:left;">
	            	<button class="btn btn-alt m-r-5" style="height: 30px;font-size: 10px;" onclick="beginAudit()">开始审核</button>
	            </div>
	            <div style="margin:10px 10px;float:left;">
	            	<button class="btn btn-alt m-r-5" style="height: 30px;font-size: 10px;" onclick="faDepreciation()">查看固定资产折旧明细表</button>
	            </div>
	            <div class="clearfix"></div>
                <hr class="whiter" style="margin-bottom:10px"/>
                <div style="text-align:center" id="warning"></div>
                <div id="dataDiv">
	                <div id="invoice" style="display:none;">
	                	<div class="row">
	                		<div class="form-group" style="text-align:center">
	                			<label class="col-md-1 control-label" style="margin-top:4px">销售方</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="xfMc">
	                            </div>
	                            <label class="col-md-1 control-label" style="margin-top:4px">购买方</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="gfMc">
	                            </div>
	                            <label class="col-md-1 control-label" style="margin-top:4px">发票号码</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="fphm">
	                            </div>
								<label class="col-md-1 control-label" style="margin-top:4px">发票代码</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="fpdm">
	                            </div>
	                		</div>
	                		<div class="form-group" style="text-align:center">
	                			<label class="col-md-1 control-label" style="margin-top:4px">开票日期</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="kprq">
	                            </div>
	                            <label class="col-md-1 control-label" style="margin-top:4px">发票类型</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="fplx">
	                            </div>
	                            <label class="col-md-1 control-label" style="margin-top:4px">价税合计</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="jshj">
	                            </div>
								<label class="col-md-1 control-label" style="margin-top:4px">税额合计</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="tax">
	                            </div>
	                		</div>
	                        <hr class="whiter deleteMark" style="margin:10px"/>
	                    </div>
	                </div>
	                <div id="expense" style="display:none;">
	                	<div class="row">
	                		<div class="form-group" style="text-align:center">
	                			<label class="col-md-1 control-label" style="margin-top:4px">金额</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="amount">
	                            </div>
	                            <label class="col-md-1 control-label" style="margin-top:4px">类型</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="expense_type">
	                            </div>
	                            <label class="col-md-1 control-label" style="margin-top:4px">部门</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="department">
	                            </div>
								<label class="col-md-1 control-label" style="margin-top:4px">税额</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="tax">
	                            </div>
	                		</div>
	                        <hr class="whiter" style="margin:10px"/>
	                    </div>
	                </div>
	                <div id="salary" style="display:none;">
	                	<div class="row">
	                		<div class="form-group" style="text-align:center">
	                			<label class="col-md-1 control-label" style="margin-top:4px">员工性质</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="employee_nature">
	                            </div>
	                            <label class="col-md-1 control-label" style="margin-top:4px">手机号</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="phone">
	                            </div>
	                            <label class="col-md-1 control-label" style="margin-top:4px">姓名</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="name">
	                            </div>
								<label class="col-md-1 control-label" style="margin-top:4px">工资总额</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="wage">
	                            </div>
	                		</div>
	                		<div class="form-group" style="text-align:center">
	                			<label class="col-md-1 control-label" style="margin-top:4px">养老金</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="endowment_person">
	                            </div>
	                            <label class="col-md-1 control-label" style="margin-top:4px">失业险</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="unemployment_person">
	                            </div>
	                            <label class="col-md-1 control-label" style="margin-top:4px">医疗险</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="medical_person">
	                            </div>
								<label class="col-md-1 control-label" style="margin-top:4px">公积金</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="house_provident_person">
	                            </div>
	                		</div>
	                		<div class="form-group" style="text-align:center">
	                			<label class="col-md-1 control-label" style="margin-top:4px">养老金(司)</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="endowment_company">
	                            </div>
	                            <label class="col-md-1 control-label" style="margin-top:4px">失业险(司)</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="unemployment_company">
	                            </div>
	                            <label class="col-md-1 control-label" style="margin-top:4px">医疗险(司)</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="medical_company">
	                            </div>
								<label class="col-md-1 control-label" style="margin-top:4px">工伤险(司)</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="injury_company">
	                            </div>
	                		</div>
	                		<div class="form-group" style="text-align:center">
	                			<label class="col-md-1 control-label" style="margin-top:4px">生育险(司)</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="birth_company">
	                            </div>
	                            <label class="col-md-1 control-label" style="margin-top:4px">公积金(司)</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="house_provident_company">
	                            </div>
	                            <label class="col-md-1 control-label" style="margin-top:4px">个税</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="tax">
	                            </div>
								<label class="col-md-1 control-label" style="margin-top:4px">实发工资</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="real_wage">
	                            </div>
	                		</div>
	                        <hr class="whiter" style="margin:10px"/>
	                    </div>
	                </div>
	                <div id="bank" style="display:none;">
	                	<div class="row">
	                		<div class="form-group" style="text-align:center">
	                			<label class="col-md-1 control-label" style="margin-top:4px">交易时间</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="trade_time">
	                            </div>
	                            <label class="col-md-1 control-label" style="margin-top:4px">收入</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="income">
	                            </div>
	                            <label class="col-md-1 control-label" style="margin-top:4px">支出</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="cost">
	                            </div>
								<label class="col-md-1 control-label" style="margin-top:4px">余额</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="balance">
	                            </div>
	                		</div>
	                		<div class="form-group" style="text-align:center">
	                			<label class="col-md-1 control-label" style="margin-top:4px">对方户名</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="pay_account_name">
	                            </div>
	                            <label class="col-md-1 control-label" style="margin-top:4px">摘要</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="abstract_">
	                            </div>
	                            <label class="col-md-1 control-label" style="margin-top:4px">用途</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="purpose">
	                            </div>
								<label class="col-md-1 control-label" style="margin-top:4px">备注</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="remark">
	                            </div>
	                		</div>
	                        <hr class="whiter" style="margin:10px"/>
	                    </div>
	                </div>
	                <div id="voucher" style="display:none;height:300px;overflow-y:auto">
	                	<table id="voucherTable" style="width:90%;text-align:center;margin:auto">
	                		<thead>
	                			<tr>
							    	<th style="width:10%;text-align:center;">日期</th>
							    	<th style="width:10%;text-align:center;">凭证类型</th>
							    	<th style="width:10%;text-align:center;">0</th>
							    	<th style="width:10%;text-align:center;">附件张数</th>
							    	<th style="width:10%;text-align:center;">摘要</th>
							    	<th style="width:10%;text-align:center;">科目</th>
							    	<th style="width:10%;text-align:center;">借方</th>
							    	<th style="width:10%;text-align:center;">贷方</th>
							    	<th style="width:10%;text-align:center;">制单</th>
							    </tr>
	                		</thead>
							<tbody></tbody>
	                	</table>
	                	<hr class="whiter" style="margin:10px"/>
	                	<div class="row" style="margin-left: 200px;">
	                		<div class="form-group" style="text-align:center">
	                			<label class="col-md-1 control-label" style="margin-top:4px">字典</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="dict">
	                            </div>
	                            <label class="col-md-1 control-label" style="margin-top:4px">科目代码</label>
	                            <div class="col-md-2">
	                                <input class="form-control input-sm" id="subject" placeholder="固定资产为1601-n(n为类型)">
	                            </div>
	                            <div class="col-md-2">
	                                <button class="btn m-r-5" onclick="updateDict()">提交修改</button>
	                            </div>
	                		</div>
	                	</div>
	                	<hr class="whiter" style="margin:10px"/>
	                	<div style="text-align:center;margin-top:10px"><button class="btn m-r-5" onclick="next()">下一张</button></div>
	                </div>
	            </div>
            	<div class="modal fade" id="modalWider" tabindex="-1" role="dialog" aria-hidden="true">
                        <div class="modal-dialog modal-lg">
                            <div class="modal-content">
                                <div class="modal-header" style="text-align:center">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                    <h4 class="modal-title">当月固定资产折旧明细表</h4>
                                </div>
                                <div class="modal-body">
                                    <table class="table tile">
				                        <thead>
				                            <tr>
				                                <th>序号</th>
				                                <th>记账月份</th>
				                                <th>分类</th>
				                                <th>名称</th>
				                                <th>资产原值 </th>
				                                <th>预计残值 </th>
				                                <th>摊销折旧年限（月）</th>
				                                <th>残值率</th>
				                                <th>月折旧额</th>
				                                <th>累计摊销月数</th>
				                                <th>本月计提折旧</th>
				                                <th>累计折旧</th>
				                                <th>净值</th>
				                            </tr>
				                        </thead>
				                        <tbody>
				                        </tbody>
				                    </table>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-sm" data-dismiss="modal">关闭</button>
                                </div>
                            </div>
                        </div>
                    </div>
            </section>
        </section>
        
        <!-- Javascript Libraries -->
        <!-- jQuery -->
        <script src="/ynrfinance/static/js/jquery.min.js"></script> <!-- jQuery Library -->
        <script src="/ynrfinance/static/js/jquery-ui.min.js"></script> <!-- jQuery UI -->
        <script src="/ynrfinance/static/js/bootstrap-datetimepicker.js"></script>
		<script src="/ynrfinance/static/js/bootstrap-datetimepicker.zh-CN.js"></script>
        <script src="/ynrfinance/static/js/jquery.easing.1.3.js"></script> <!-- jQuery Easing - Requirred for Lightbox + Pie Charts-->
        <!-- Bootstrap -->
        <script src="/ynrfinance/static/js/bootstrap.min.js"></script>
        <script src="/ynrfinance/static/js/datetimepicker.min.js"></script>
        <!--  Form Related -->
        <script src="/ynrfinance/static/js/icheck.js"></script> <!-- Custom Checkbox + Radio -->
        <!-- UX -->
        <script src="/ynrfinance/static/js/scroll.min.js"></script> <!-- Custom Scrollbar -->
        <!-- Other -->
        <script src="/ynrfinance/static/js/calendar.min.js"></script><!-- Calendar -->
        <script src="/ynrfinance/static/js/fileupload.min.js"></script> <!-- File Upload -->
        <script src="/ynrfinance/static/js/select.min.js"></script> <!-- Custom Select -->
        <script src="/ynrfinance/static/js/chosen.min.js"></script> <!-- Custom Multi Select -->
        <!-- All JS functions -->
        <script src="/ynrfinance/static/js/functions.js"></script>
        <script src="/ynrfinance/static/js/common.js"></script>
        <script src="/ynrfinance/static/js/invoice_input/audit_voucher.js"></script>
        <script type="text/javascript">
        	$.post('/ynrfinance/getAllCompany', {}, function(data) {
        		var companyList = data.data;
        		for(var i in companyList) {
        			console.log(companyList[i].id + ":" + companyList[i].name);
        			$('.tag-select-limited')[0].add(new Option(companyList[i].name, companyList[i].id));
        		}
        		$(".tag-select-limited").trigger("chosen:updated");
        		$(".tag-select-limited").chosen();
        	});
        	
        </script>
    </body>
</html>
